package cn.wei.youvie.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import lombok.Data;

/**
 * 存储书籍中的章节信息
 */
@TableName(value ="chapters")
@Data
public class Chapter implements Serializable {
    /**
     * 唯一标识章节的 ID
     */
    @TableId(value = "chapter_id", type = IdType.AUTO)
    private Integer chapterId;

    /**
     * 书籍的 ID，外键关联 books 表
     */
    @TableField(value = "book_id")
    private Integer bookId;

    /**
     * 章节编号，用于章节排序
     */
    @TableField(value = "chapter_number")
    private Integer chapterNumber;

    /**
     * 章节标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 是否删除
     */
    @TableField(value = "is_delete")
    private Integer isDelete;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}